<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数组升序排列</title>
    <script>
        var arr = [1, 9, 4, 0, 6, 11, 3, 2];
        let newArr = arr.sort(function (a, b) {
             return a-b
        })
        console.log(newArr);
       </script>
       
</head>
<body>
    
</body>
</html>